#include<bits/stdc++.h>
#define int long long
#define for(i, a, b) for(int (i)=(a); (i)<=(b); (i)++)
using namespace std;
const int N = 1e5+10;
int n, ans, cnt=1, a[N], b[N];
signed main()
{
    freopen("duel.in","r",stdin);
    freopen("duel.out","w",stdout);
    cin >> n;
    ans = n;
    for(i, 1, n)
    {
        int x;
        cin >> x;
        a[x]++;
    }
    for(i, 1, N)
        if(a[i]) b[cnt]=a[i], cnt++;
    int l=1, r=2, tmp=2, left=b[r];
    while(l<cnt-1 && r<cnt)
    {
        if(b[l] <= left)
        {
            ans -= b[l];
            left -= b[l];
            b[l] = 0;
            l=tmp, tmp++;
            if(tmp-1==r) r++, left=b[r];
        }
        else
        {
            ans -= left;
            b[l] -= left;
            tmp=l+1, r++, left=b[r];
        }
    }
    cout << ans;
    return 0;
}
